package com.ff.mapper;

import static com.ff.mapper.FuserDynamicSqlSupport.*;
import static org.mybatis.dynamic.sql.SqlBuilder.*;

import com.ff.model.Fuser;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import javax.annotation.Generated;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.mybatis.dynamic.sql.BasicColumn;
import org.mybatis.dynamic.sql.delete.DeleteDSLCompleter;
import org.mybatis.dynamic.sql.delete.render.DeleteStatementProvider;
import org.mybatis.dynamic.sql.insert.render.InsertStatementProvider;
import org.mybatis.dynamic.sql.insert.render.MultiRowInsertStatementProvider;
import org.mybatis.dynamic.sql.select.CountDSLCompleter;
import org.mybatis.dynamic.sql.select.SelectDSLCompleter;
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
import org.mybatis.dynamic.sql.update.UpdateDSL;
import org.mybatis.dynamic.sql.update.UpdateDSLCompleter;
import org.mybatis.dynamic.sql.update.UpdateModel;
import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider;
import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
import org.mybatis.dynamic.sql.util.mybatis3.MyBatis3Utils;

@Mapper
public interface FuserMapper {

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3028076+08:00", comments = "Source Table: fuser")
	BasicColumn[] selectList = BasicColumn.columnList(fid, fname, fage, fsex, fidcard, fusername, fpassword, power);

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3018119+08:00", comments = "Source Table: fuser")
	@SelectProvider(type = SqlProviderAdapter.class, method = "select")
	long count(SelectStatementProvider selectStatement);

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3018119+08:00", comments = "Source Table: fuser")
	@DeleteProvider(type = SqlProviderAdapter.class, method = "delete")
	int delete(DeleteStatementProvider deleteStatement);

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3018119+08:00", comments = "Source Table: fuser")
	@InsertProvider(type = SqlProviderAdapter.class, method = "insert")
	int insert(InsertStatementProvider<Fuser> insertStatement);

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3018119+08:00", comments = "Source Table: fuser")
	@InsertProvider(type = SqlProviderAdapter.class, method = "insertMultiple")
	int insertMultiple(MultiRowInsertStatementProvider<Fuser> multipleInsertStatement);

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3018119+08:00", comments = "Source Table: fuser")
	@SelectProvider(type = SqlProviderAdapter.class, method = "select")
	@ResultMap("FuserResult")
	Optional<Fuser> selectOne(SelectStatementProvider selectStatement);

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3018119+08:00", comments = "Source Table: fuser")
	@SelectProvider(type = SqlProviderAdapter.class, method = "select")
	@Results(id = "FuserResult", value = {
			@Result(column = "fid", property = "fid", jdbcType = JdbcType.INTEGER, id = true),
			@Result(column = "fname", property = "fname", jdbcType = JdbcType.VARCHAR),
			@Result(column = "fage", property = "fage", jdbcType = JdbcType.INTEGER),
			@Result(column = "fsex", property = "fsex", jdbcType = JdbcType.VARCHAR),
			@Result(column = "fidcard", property = "fidcard", jdbcType = JdbcType.VARCHAR),
			@Result(column = "fusername", property = "fusername", jdbcType = JdbcType.VARCHAR),
			@Result(column = "fpassword", property = "fpassword", jdbcType = JdbcType.VARCHAR),
			@Result(column = "power", property = "power", jdbcType = JdbcType.INTEGER) })
	List<Fuser> selectMany(SelectStatementProvider selectStatement);

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3018119+08:00", comments = "Source Table: fuser")
	@UpdateProvider(type = SqlProviderAdapter.class, method = "update")
	int update(UpdateStatementProvider updateStatement);

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3018119+08:00", comments = "Source Table: fuser")
	default long count(CountDSLCompleter completer) {
		return MyBatis3Utils.countFrom(this::count, fuser, completer);
	}

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3018119+08:00", comments = "Source Table: fuser")
	default int delete(DeleteDSLCompleter completer) {
		return MyBatis3Utils.deleteFrom(this::delete, fuser, completer);
	}

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3018119+08:00", comments = "Source Table: fuser")
	default int deleteByPrimaryKey(Integer fid_) {
		return delete(c -> c.where(fid, isEqualTo(fid_)));
	}

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3018119+08:00", comments = "Source Table: fuser")
	default int insert(Fuser record) {
		return MyBatis3Utils.insert(this::insert, record, fuser,
				c -> c.map(fid).toProperty("fid").map(fname).toProperty("fname").map(fage).toProperty("fage").map(fsex)
						.toProperty("fsex").map(fidcard).toProperty("fidcard").map(fusername).toProperty("fusername")
						.map(fpassword).toProperty("fpassword").map(power).toProperty("power"));
	}

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3018119+08:00", comments = "Source Table: fuser")
	default int insertMultiple(Collection<Fuser> records) {
		return MyBatis3Utils.insertMultiple(this::insertMultiple, records, fuser,
				c -> c.map(fid).toProperty("fid").map(fname).toProperty("fname").map(fage).toProperty("fage").map(fsex)
						.toProperty("fsex").map(fidcard).toProperty("fidcard").map(fusername).toProperty("fusername")
						.map(fpassword).toProperty("fpassword").map(power).toProperty("power"));
	}

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3018119+08:00", comments = "Source Table: fuser")
	default int insertSelective(Fuser record) {
		return MyBatis3Utils.insert(this::insert, record, fuser,
				c -> c.map(fid).toPropertyWhenPresent("fid", record::getFid).map(fname)
						.toPropertyWhenPresent("fname", record::getFname).map(fage)
						.toPropertyWhenPresent("fage", record::getFage).map(fsex)
						.toPropertyWhenPresent("fsex", record::getFsex).map(fidcard)
						.toPropertyWhenPresent("fidcard", record::getFidcard).map(fusername)
						.toPropertyWhenPresent("fusername", record::getFusername).map(fpassword)
						.toPropertyWhenPresent("fpassword", record::getFpassword).map(power)
						.toPropertyWhenPresent("power", record::getPower));
	}

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3028076+08:00", comments = "Source Table: fuser")
	default Optional<Fuser> selectOne(SelectDSLCompleter completer) {
		return MyBatis3Utils.selectOne(this::selectOne, selectList, fuser, completer);
	}

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3028076+08:00", comments = "Source Table: fuser")
	default List<Fuser> select(SelectDSLCompleter completer) {
		return MyBatis3Utils.selectList(this::selectMany, selectList, fuser, completer);
	}

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3028076+08:00", comments = "Source Table: fuser")
	default List<Fuser> selectDistinct(SelectDSLCompleter completer) {
		return MyBatis3Utils.selectDistinct(this::selectMany, selectList, fuser, completer);
	}

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3028076+08:00", comments = "Source Table: fuser")
	default Optional<Fuser> selectByPrimaryKey(Integer fid_) {
		return selectOne(c -> c.where(fid, isEqualTo(fid_)));
	}

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3028076+08:00", comments = "Source Table: fuser")
	default int update(UpdateDSLCompleter completer) {
		return MyBatis3Utils.update(this::update, fuser, completer);
	}

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3028076+08:00", comments = "Source Table: fuser")
	static UpdateDSL<UpdateModel> updateAllColumns(Fuser record, UpdateDSL<UpdateModel> dsl) {
		return dsl.set(fid).equalTo(record::getFid).set(fname).equalTo(record::getFname).set(fage)
				.equalTo(record::getFage).set(fsex).equalTo(record::getFsex).set(fidcard).equalTo(record::getFidcard)
				.set(fusername).equalTo(record::getFusername).set(fpassword).equalTo(record::getFpassword).set(power)
				.equalTo(record::getPower);
	}

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3028076+08:00", comments = "Source Table: fuser")
	static UpdateDSL<UpdateModel> updateSelectiveColumns(Fuser record, UpdateDSL<UpdateModel> dsl) {
		return dsl.set(fid).equalToWhenPresent(record::getFid).set(fname).equalToWhenPresent(record::getFname).set(fage)
				.equalToWhenPresent(record::getFage).set(fsex).equalToWhenPresent(record::getFsex).set(fidcard)
				.equalToWhenPresent(record::getFidcard).set(fusername).equalToWhenPresent(record::getFusername)
				.set(fpassword).equalToWhenPresent(record::getFpassword).set(power)
				.equalToWhenPresent(record::getPower);
	}

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3028076+08:00", comments = "Source Table: fuser")
	default int updateByPrimaryKey(Fuser record) {
		return update(c -> c.set(fname).equalTo(record::getFname).set(fage).equalTo(record::getFage).set(fsex)
				.equalTo(record::getFsex).set(fidcard).equalTo(record::getFidcard).set(fusername)
				.equalTo(record::getFusername).set(fpassword).equalTo(record::getFpassword).set(power)
				.equalTo(record::getPower).where(fid, isEqualTo(record::getFid)));
	}

	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2022-06-15T17:32:43.3028076+08:00", comments = "Source Table: fuser")
	default int updateByPrimaryKeySelective(Fuser record) {
		return update(c -> c.set(fname).equalToWhenPresent(record::getFname).set(fage)
				.equalToWhenPresent(record::getFage).set(fsex).equalToWhenPresent(record::getFsex).set(fidcard)
				.equalToWhenPresent(record::getFidcard).set(fusername).equalToWhenPresent(record::getFusername)
				.set(fpassword).equalToWhenPresent(record::getFpassword).set(power).equalToWhenPresent(record::getPower)
				.where(fid, isEqualTo(record::getFid)));
	}
}